package com.ycw.controller.guoguo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ycw.bean.Users;
import com.ycw.service.guoguo.SubscriberManagementService;
import com.ycw.util.Msg;
/**
 * 注册用户管理功能
 * @author gcz
 *
 */
@Controller
public class SubscriberManagementController {

	@Autowired
	private SubscriberManagementService subscriberManagementService;
	
	/**
	 * 注册用户管理功能
	 * 用户列表分页查询
	 * @param pageNum
	 * @param users
	 * @return
	 */
	@RequestMapping("getAllUsers")
	@ResponseBody
	public Msg getAllUsers(@RequestParam(defaultValue="1")Integer pageNum, Users users){
		return subscriberManagementService.getAllUsers(pageNum, users);		
	}
	
	/**注册用户管理功能
	 * 用户根据id查询用户信息
	 * @param users
	 * @return
	 */
	@RequestMapping("geyUsersById")
	@ResponseBody
	public Msg geyUsersById(Users users){
		return subscriberManagementService.geyUsersById(users);
	}
	
	/**注册用户管理功能
	 * 用户根据id修改用户信息
	 * @param users
	 * @return
	 */
	@RequestMapping("alertUsersById")
	@ResponseBody
	public Msg alertUsersById(Users users){
		return subscriberManagementService.alertUsersById(users);
	}
	
	/**
	 * 根据用户id得到用户的余额(usMoney)，投资明细(fundings)，总支出(totalMoney)
	 * @param
	 * @return
	 */
	@RequestMapping("getUsersMoneyById")
	@ResponseBody
	public Msg getUsersMoneyById(Users users){
		return subscriberManagementService.getUsersMoneyById(users);
	}
}
